//
//  SuccessView.m
//  FruitVIP
//
//  Created by 孙艳玲 on 15/7/16.
//  Copyright (c) 2015年 孙艳玲. All rights reserved.
//

#import "SuccessView.h"

#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)

@implementation SuccessView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self getUI];
    }
    return self;
}

- (void)getUI
{
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame =CGRectMake(SCREEN_WIDTH/4, SCREEN_WIDTH/4, 50, 50);
    button.layer.cornerRadius = CGRectGetHeight([button bounds])/2;
    button.backgroundColor = [UIColor greenColor];
    [button setBackgroundImage:[UIImage imageNamed:@"paycount.png"] forState:UIControlStateNormal];
    [self addSubview:button];
    
    UILabel *successLabel = [[UILabel alloc] initWithFrame:CGRectMake(button.frame.origin.x + button.frame.size.width + 10 , button.frame.origin.y, SCREEN_WIDTH/2 - 30, 20)];
    successLabel.text = @"付款成功";
    successLabel.font = [UIFont systemFontOfSize:22];
    [self addSubview:successLabel];
    
    
    UILabel *backLabel = [[UILabel alloc] initWithFrame:CGRectMake(successLabel.frame.origin.x, successLabel.frame.origin.y + successLabel.frame.size.height + 10, successLabel.frame.size.width, 15)];
    backLabel.text = @"感谢您信任提鲜";
    backLabel.textColor = [UIColor colorWithRed:110.0 / 255.0 green:78.0 / 255.0 blue:71.0 / 255.0 alpha:1];
    backLabel.font = [UIFont systemFontOfSize:13];
    [self addSubview:backLabel];
    
    
    
    UIButton *continueButton = [UIButton buttonWithType:UIButtonTypeCustom];
    continueButton.frame = CGRectMake(SCREEN_WIDTH/4, button.frame.origin.y + button.frame.size.height + 50, SCREEN_WIDTH/2, SCREEN_WIDTH/8);
    [continueButton setTitle:@"继续提鲜" forState:UIControlStateNormal];
    [continueButton setTitleColor:[UIColor colorWithRed:110.0 / 255.0 green:78.0 / 255.0 blue:71.0 / 255.0 alpha:1] forState:UIControlStateNormal];
    continueButton.backgroundColor = [UIColor colorWithRed:255.0/255.0 green:205.0 / 255.0 blue:0 / 255.0 alpha:1];
    continueButton.titleLabel.font = [UIFont systemFontOfSize:15];
    continueButton.titleLabel.textAlignment = NSTextAlignmentCenter;
    continueButton.layer.cornerRadius = CGRectGetHeight([continueButton bounds])/2;
    [self addSubview:continueButton];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
